package com.design.command;

import java.util.ArrayList;

/**
 * @author leali
 * @title: FBSettingWindow
 * @projectName design
 * @description: 功能键设置窗口类
 * @date 2022/1/3 16:51
 */
public class FBSettingWindow {
    private String title;
    /**
     * 定义一个ArrayList来存储所有功能键
     */
    private final ArrayList<FunctionButton> functionButtons = new ArrayList<>();

    public FBSettingWindow(String title) {
        this.title = title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getTitle() {
        return this.title;
    }

    public void addFunctionButton(FunctionButton fb) {
        functionButtons.add(fb);
    }

    public void removeFunctionButton(FunctionButton fb) {
        functionButtons.remove(fb);
    }


    public void display() {
        System.out.println("显示窗口：" + this.title);
        System.out.println("显示功能键：");
        for (FunctionButton obj : functionButtons) {
            System.out.println(obj.getName());
        }
        System.out.println("------------------------------");
    }
}
